import { getApi, postApi } from '../commonApi/config.js'

// 用户登陆
const userLogin = (params) => {
	return postApi("/shopapi/login/account", params)
}
// 用户信息
const getUserInfo = () => {
	return postApi("/shopapi/user/centre")
}
// 获取验证码
const getCode = (params) => {
	return postApi("/shopapi/login/captcha", params)
}
//获取彩票列表
const getlotterylist = (type,status,page) => {
	return getApi(`/shopapi/czz_lottery_user/list?type=${type}&status=${status}&page=${page}`)
}

//彩票下拉列表
const getlotterytypelist = () => {
	return getApi('/shopapi/czz_lottery_user/config')
}

//彩票手动录入
const inheadlottery = (params) => {
	return postApi('/shopapi/czz_lottery/add',params)
}

//图片上传
const uploadImage = (params) => {
	return postApi('/shopapi/upload/image',params)
}

//隐私政策
const getPrivacyPolicy = (type) => {
	return getApi(`/shopapi/config/getPolicyAgreement?type=${type}`)
}

//退出登录
const loginOut = () => {
	return postApi("/shopapi/login/logout")
}

export default {
	loginOut,
	getCode,
	getUserInfo,
	uploadImage,
	userLogin,
	inheadlottery,
	getlotterylist,
	getPrivacyPolicy,
	getlotterytypelist
}